package com.project.common.domain.entity;

import com.project.common.domain.po.BaseAutoKeyPO;
import io.swagger.v3.oas.annotations.media.Schema;
import javax.persistence.Column;
import javax.persistence.MappedSuperclass;
import lombok.Data;
import org.springframework.data.annotation.CreatedBy;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedBy;
import org.springframework.data.annotation.LastModifiedDate;
import java.time.LocalDateTime;

/**
 * @author: 陈刚
 * @description:
 * @date: 2022/10/3 23:18
 **/
@Data
@MappedSuperclass
public class Permissions extends BaseAutoKeyPO {
    @Schema(description = "创建人")
    @CreatedBy
    @Column(name = "create_by")
    private Long createBy;

    @Schema(description = "创建时间")
    @Column(name = "create_time")
    @CreatedDate
    private LocalDateTime createTime;

    @Schema(description = "更新时间")
    @LastModifiedDate
    @Column(name = "update_time")
    private LocalDateTime updateTime;

    @Schema(description = "更新人")
    @CreatedBy
    @LastModifiedBy
    @Column(name = "update_by")
    private Long updateBy;

    @Schema(description = "权限编码")
    private Integer code;

    @Schema(description = "权限名称")
    @Column(columnDefinition = "varchar(32) DEFAULT NULL COMMENT '权限名称'")
    private String name;

    @Schema(description = "权限路径")
    @Column(columnDefinition = "varchar(32) DEFAULT NULL COMMENT '权限路径/控制编码'")
    private String path;

    @Schema(description = "权限标识")
    @Column(columnDefinition = "varchar(64) DEFAULT NULL COMMENT '权限标识'")
    private String perms;

    @Schema(description = "显示顺序")
    @Column(columnDefinition = "int DEFAULT NULL COMMENT '显示顺序'")
    private Integer sort;

    @Schema(description = "权限类型（1-不授权（公用），2-需授权）")
    @Column(columnDefinition = "tinyint(3) DEFAULT '1' COMMENT '权限类型（1-不授权（公用），2-需授权）'")
    private Integer type;

    @Schema(description = "权限来源（（1-系统URL，2-前端定义））")
    @Column(columnDefinition = "int DEFAULT NULL COMMENT '权限来源'")
    private Integer souece;
}
